FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openjdk:8u342-jdk
#FROM docker.io/openjdk:8u342-jdk
LABEL maintainer="ilanni <ilanni@ilanni.com>"
LABEL description="APP Service"

ARG APP_ENV=test
ENV APP_ENV="${APP_ENV}"

ARG JAVA_OPTS=""
ENV JAVA_OPTS="{$JAVA_OPTS}"

WORKDIR /app/

EXPOSE 7070 8080 9191 9292 9393 9494 9595

CMD java \
  ${JAVA_OPTS} \
  -Djava.security.egd=file:/dev/./urandom \
  -XX:+UseContainerSupport \
  -XX:MaxRAMPercentage=75.0 \
  -XX:+HeapDumpOnOutOfMemoryError \
  -XX:HeapDumpPath=/app/logs/java_heapdump.hprof \
  -XX:+UseG1GC \
  -Dspring.profiles.active=${APP_ENV} \
  -jar ./app.jar \
  --server.port=8080

COPY ./app.jar ./